When we pass "" as reason, gnome-session responds
with a "Reason not specified" error. So, send
"Reason not specified" instead. Its true.
#include "gtkapplicationprivate.h"
#include "gtksettings.h"
#include "gtkprivate.h"
+#include "gtkintl.h"
#include "gdk/gdkconstructor.h"
if (dbus->sm_proxy)
{
+ if (reason == NULL)
+ /* Translators: This is the 'reason' given when inhibiting
+ * suspend or screen locking, and the caller hasn't specified
+ * a reason.
+ */
+ reason = _("Reason not specified");
+
res = g_dbus_proxy_call_sync (dbus->sm_proxy,
"Inhibit",
g_variant_new ("(s@usu)",
dbus->application_id,
window ? gtk_application_impl_dbus_get_window_system_id (dbus, window) : g_variant_new_uint32 (0),
- reason ? reason : "",
+ reason,
flags),
G_DBUS_CALL_FLAGS_NONE,
G_MAXINT,